package com.mymall.serve.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mymall.serve.entity.MallProduct;
import com.mymall.serve.mapper.MallProductMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class MallProductService extends ServiceImpl<MallProductMapper, MallProduct> {

    /**
     * 根据id列表返回实体列表
     * @author weiwei
     * @param productIds idList
     * @date 2020/4/16 16:40
     * @return java.util.List<com.mymall.serve.entity.MallProduct>
     */
    public List<MallProduct> getListByIds(List<Long> productIds) {
        QueryWrapper<MallProduct> wrapper = new QueryWrapper<>();
        wrapper.in("id",productIds);
        return this.list(wrapper);
    }
}
